home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / newsgroups / misc.19960715-19961006 / 000045_news@columbia.edu _Sun Jul 21 13:20:04 1996.msg < prev    next >
Internet Message Format  |  1996-11-03  |  6KB

  1. Return-Path: news@columbia.edu
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30]) by watsun.cc.columbia.edu (8.7.5/8.7.3) with ESMTP id NAA05250 for <kermit.misc@watsun.cc.columbia.edu>; Sun, 21 Jul 1996 13:20:04 -0400 (EDT)
  3. Received: (from news@localhost) by newsmaster.cc.columbia.edu (8.7.5/8.7.3) id NAA28820 for kermit.misc@watsun; Sun, 21 Jul 1996 13:20:03 -0400 (EDT)
  4. Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
  5. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  6. Newsgroups: comp.protocols.kermit.misc
  7. Subject: Re: dial script for Telepath II v modem
  8. Date: 21 Jul 1996 17:19:43 GMT
  9. Organization: Columbia University
  10. Lines: 167
  11. Message-ID: <4storf$g00@apakabar.cc.columbia.edu>
  12. References: <4ssafj$5kn@news.iastate.edu>
  13. NNTP-Posting-Host: watsun.cc.columbia.edu
  14. Keywords: Telepath II v
  15.  
  16. Try this and let me know if it works OK:
  17.  
  18. ---(cut here)---
  19. ; FILE TELEPATH.SCR
  20. ;
  21. ; An MS-DOS Kermit script program for dialing the Hayes Gateway Telepath II
  22. ; modem, to be used with MS-DOS Kermit 3.12 or later.  The modem is set up for
  23. ; compression, error correction, all types of fallback, RTS/CTS flow control,
  24. ; fixed interface speed of 38400, which is the highest support by this modem.
  25. ;
  26. ; Authors: Christine M. Gianone, Frank da Cruz; Columbia U, July 1996
  27. ;
  28. def errfail echo \%1, hangup, goto fail ; Macro to handle failures.
  29. if < VERSION 312 errfail {MS-DOS Kermit 3.12 or later required.}
  30. if eq "\v(system)" "UNIX" if = \v(local) 0 stop 1 You must SET LINE first
  31.  
  32. define chkerr if fail stop 1 \%1
  33. define chkok input 3 OK, if fail stop 1 \%1
  34.  
  35. define max_speed 57600        ; Maximum interface speed
  36.  
  37. ; Macro to try to get attention of modem's command processor
  38. ; at the given speed, or if no speed given, at the current speed.
  39. ; Q0 = Enable result codes, V1 = display result codes as words.
  40. ;
  41. define atok -
  42.  if def \%1 set speed \%1, -
  43.  echo Trying \%1..., -
  44.  output ATQ0V1\13, -
  45.  input 3 OK, -
  46.  if success goto gotok
  47.  
  48. set input echo on        ; So we can watch what happens.
  49. set input timeout proceed       ; Allow IF SUCCESS, IF FAILURE.
  50. set input case ignore        ; Use caseless string comparisons
  51.  
  52. set parity none            ; Avoid parity foulups
  53. set flow none            ; Avoid flow control deadlocks
  54. hangup                ; Begin by dropping DTR
  55. pause 1                ; for one second
  56.  
  57. echo Configuring Hayes ULTRA 144 on \v(line).
  58.  
  59. atok            ; Try to connect at current speed, whatever it is.
  60. atok 9600         ; If that didn't work, try to connect at 9600.
  61. atok 19200        ; 19200...
  62. atok 2400        ; 2400...
  63. atok 19200        ; 19200...
  64. atok 38400        ; 38400...
  65. stop 1 Can't get modem's attention
  66.  
  67. :GOTOK
  68. ;
  69. ; Now change interface speed to the maximum
  70. ;
  71. echo Locking interface speed at \m(max_speed)...
  72. output ATS87=28\13
  73. chkok {Can't set modem's speed to \m(max_speed)}
  74. set speed \m(max_speed)
  75.  
  76. ; Try 3 times to get OK response to AT command at new speed.
  77. ;
  78. set count 3
  79. :LOOP
  80. pause
  81. output AT\13
  82. input 3 OK
  83. if success goto ok
  84. if count goto loop
  85. Stop 1 Can't communicate with modem at \m(max_speed)
  86.  
  87. :OK ; Initialize the modem.
  88.  
  89. output AT Q0X4&N0&Y1#CLS=0S13=0S15=0S19\13
  90. chkok {Can't initialize modem}
  91.  
  92. ; Enable hardware flow control
  93. ;
  94. echo Enabling hardware flow control...
  95. output AT&H1&R2\13        ; Enable RTS/CTS hardware flow control
  96. chkok {Can't enable RTS/CTS}    ; On modem
  97. wait 5 cts
  98. if fail errfail {Modem is not asserting CTS!}
  99. set flow rts/cts        ; And in Kermit too, but only now
  100.  
  101. echo Enabling error correction and data compression...
  102. output AT&M4&B1&K1\13
  103. chkok {Can't enable compression and EC}
  104.  
  105. if def \%1 if not equal "\%1" "=" goto BEGIN
  106. ;
  107. ; User only wanted to initialize the modem.
  108. ; Display configuration.
  109. ;
  110. echo Telepath initialized OK.
  111.  
  112. :BEGIN
  113. ;
  114. ; User wants to dial.
  115. ;
  116. clear                ; Clear INPUT buffer.
  117. set count 5                     ; Dialing retry counter, 5 tries allowed.
  118. echo Dialing \%1 on \v(line) at \v(speed) bps, wait...
  119. echo
  120. pause 1
  121. goto dial                       ; 1st time, skip pause and Redialing message
  122.  
  123. :REDIAL
  124. set alarm 30
  125. pause 30            ; Wait 30 seconds before redialing.
  126. if not alarm errfail {Dialing canceled.}
  127. echo Redialing...               ; Message for redialing.
  128. pause 1
  129.  
  130. :DIAL
  131. output ATD\%1\13                ; Dial the number.
  132. set alarm 90            ; (For detecting keyboard interruptions.)
  133. if > VERSION 312 clear input    ; Clear echo from INPUT buffer.
  134. if < VERSION 313 clear
  135. input 30 \10                    ; Wait for the linefeeds...
  136.  
  137. :GETMSG
  138. input 60 \10            ; ...that surround the response message.
  139. if success goto gotmsg        ; Got a message.
  140. if alarm errfail {No response from modem.} ; No response in 90 seconds.
  141. hangup                ; User interrupted from keyboard,
  142. output \13            ; cancel dialing by sending carriage return,
  143. goto again            ; and go try again right away.
  144.  
  145. :GOTMSG
  146. reinput 1 CONNECT               ; Got a message, was it CONNECT?
  147. if success goto done            ; If so, we're done.
  148. reinput 1 BUSY            ; Line is busy.
  149. if success goto busy        ; Go wait a while and then dial again.
  150. reinput 1 ERROR            ; Command syntax error.
  151. if success errfail {Dialing command error}
  152. reinput 1 NO ANSWER        ; No answer
  153. if success errfail {No answer, please try again later}
  154. reinput 1 NO CARRIER        ; Phone didn't answer or no carrier.
  155. if success errfail {No answer or no carrier}
  156. reinput 1 NO DIALTONE        ; No dialtone when phone taken off hook.
  157. if success errfail {No dialtone - Is your modem connected to the phone line\63}
  158. reinput 1 RING            ; Phone is ringing
  159. if success errfail {Somebody is calling this number}
  160. goto getmsg            ; None of the above, get another message.
  161.  
  162. :BUSY
  163. if < \v(count) 2 goto quit    ; Don't wait 30 seconds if tries are used up.
  164. echo Line is busy, will dial again in 30 seconds.
  165. echo Press any key to cancel...
  166. :AGAIN
  167. if count goto redial            ; Then go redial.
  168. :QUIT
  169. errfail {It never answers!  I give up.} ; Too many tries.
  170.  
  171. :DONE                           ; Connected.
  172. echo \7                         ; Celebrate with a beep.
  173. define errfail            ; Erase local macro definitions...
  174. define max_speed
  175. end 0                ; Finished, return success code.
  176.  
  177. :FAIL                ; Dialing failed, no beep.
  178. define errfail            ; Erase local macro definitions...
  179. define max_speed
  180. end 1                ; Return failure code.
  181.  
  182. ; End of TELEPATH.SCR